package org.xsm.pinyougou.mapper;

import org.apache.ibatis.annotations.Mapper;

import org.apache.ibatis.annotations.Param;
import org.xsm.pinyougou.entity.TbSeckillGoods;

import java.util.List;

@Mapper
public interface TbSeckillGoodsMapper {


    /**
     * 1.查询合法的秒杀商品数据：状态为有效（status=1），库存量>0（stockCount> 0），秒杀开始时间<=当前时间<秒杀结束时间
     */
    List<TbSeckillGoods> findByTj();

    /**
     * 更新库存
     *
     * Param 需要用apache的那个
     */
    Integer updateKc(@Param("stockCount")Integer stockCount, @Param("id") Long id);



    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_seckill_goods
     *
     * @mbggenerated Fri Oct 27 14:51:02 CST 2023
     */
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_seckill_goods
     *
     * @mbggenerated Fri Oct 27 14:51:02 CST 2023
     */
    int insert(TbSeckillGoods record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_seckill_goods
     *
     * @mbggenerated Fri Oct 27 14:51:02 CST 2023
     */
    int insertSelective(TbSeckillGoods record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_seckill_goods
     *
     * @mbggenerated Fri Oct 27 14:51:02 CST 2023
     */
    TbSeckillGoods selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_seckill_goods
     *
     * @mbggenerated Fri Oct 27 14:51:02 CST 2023
     */
    int updateByPrimaryKeySelective(TbSeckillGoods record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_seckill_goods
     *
     * @mbggenerated Fri Oct 27 14:51:02 CST 2023
     */
    int updateByPrimaryKey(TbSeckillGoods record);
}